package com.itheima.map;

import java.util.Collection;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

/*
Map的第一种遍历方式
keySet()
get(key)
 */
public class Demo03 {
    public static void main(String[] args) {
        Map<String,String> map = new TreeMap<>();
        map.put("马蓉","宋喆");
        map.put("都美竹","吴亦凡");
        map.put("小吉娜","吴亦凡");
        map.put("小璐","PGone");
        map.put("爽子","张恒");
        //获取所有的键的集合  Set
        Set<String> keys = map.keySet();
        for (String key : keys) {
            //key
            String value = map.get(key);
            System.out.println(key+"="+value);

        }

        Collection<String> values = map.values();
        for (String value : values) {
            System.out.println(value);
        }

    }


}
